#pragma once

#include "common.hpp"

struct Command
{
    std::string func_popen(const std::string &com)
    {
        FILE *lo_fp = popen(com.c_str(), "r");
        if (nullptr == lo_fp)
        {
            return nullptr;
        }
        std::string res;
        char line[1024];
        while (fgets(line, sizeof(line), lo_fp))
        {
            res += line;
        }
        pclose(lo_fp);
        std::cout << res << std::endl;
        return res;
    }
};